Skip to content

Conversation

@GalileoCap
Copy link
Contributor

@GalileoCap GalileoCap commented Sep 16, 2025

Fix unnecessary_unwrap false negative when unwrapping a known value inside a macro call

Fixes #12295
Produces no changes to lintcheck

changelog: [unnecessary_unwrap]: Fix false negative when unwrapping a known value inside a macro call

I made sue to run cargo dev fmt.
I also ran the following checks (in order) on a fresh clone of mi fork:

  1. cargo build
  2. cargo test
  3. cargo lintcheck

Running cargo test after lintcheck causes a test to fail, but this also happens on a clean fork without my changes

… inside a macro call

Fixes rust-lang#12295

changelog: [`unnecessary_unwrap`]: Fix false negative when unwrapping a known value inside a macro call
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 16, 2025

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alexendoo Alexendoo added this pull request to the merge queue Sep 17, 2025
@Alexendoo
Copy link
Member

Running cargo test after lintcheck causes a test to fail, but this also happens on a clean fork without my changes

What error are you hitting here?

Merged via the queue into rust-lang:master with commit 55570c9 Sep 17, 2025
11 of 13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 17, 2025
@GalileoCap
Copy link
Contributor Author

Running cargo test after lintcheck causes a test to fail, but this also happens on a clean fork without my changes

What error are you hitting here?

running 1 test
test no_profile_in_cargo_toml ... FAILED

failures:

---- no_profile_in_cargo_toml stdout ----
Profile section `[profile.bench]` found in file `./target/lintcheck/sources/base64-0.22.1/Cargo.toml`.
Use `.cargo/config.toml` for profiles specific to the standalone Clippy repository.

thread 'no_profile_in_cargo_toml' (597541) panicked at tests/no-profile-in-cargo-toml.rs:30:17:
Profile section found in `Cargo.toml`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    no_profile_in_cargo_toml

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s

error: test failed, to rerun pass `--test no-profile-in-cargo-toml`

@samueltardieu
Copy link
Member

Interesting. I'll take this, this is a test I added recently, and it shouldn't look inside target (I never thought we were going to put some Cargo.toml there!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unnecessary_unwrap not produced in 1.76

4 participants